import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
import { getGoodsAPI } from '@/apis/home'

export const useGoodsStore = defineStore('goods', () => {
    const goodsList = ref([])
    const getGoodsList = async () => {
        let res = await getGoodsAPI()
        if (res.code == 1) {
            goodsList.value = res.result
        }
    }

    return { goodsList, getGoodsList }
})
